function validatepw() {	
	var senha = document.getElementById('Txt_senha');
	 var confirmar = document.getElementById('Txt_senha2');
	
	 alert(senha.value);
	 
	if ( senha.value != confirmar.value)
    {
		alert('As senhas estão diferentes');
        return false;
    }else{
    	alert('As senhas estão iguais');
        return true;
    }
    }




    function validate_reg() {
    var isValid = true;

    // using OLD method of using name to find the control

    if ( document.register.user_username.value == "")
    {
    document.register.user_username.style.backgroundColor="red";
    isValid=false;
    }
    else{
    document.register.user_username.style.backgroundColor="white";
    }
    if ( document.register.user_password.value == "")
    {
    document.register.user_password.style.backgroundColor="red";
    isValid=false;
    }
    else{
    document.register.user_password.style.backgroundColor="white";
    }
    if ( document.register.user_password_confirm.value == "")
    {
    document.register.user_password_confirm.style.backgroundColor="red";
    isValid=false;
    }
    else{
    document.register.user_password_confirm.style.backgroundColor="white";
    }
}
